<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>微信JS-SDK Demo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
  <script src="js/jquery-1.9.1.js"></script>
  

</head>
<body ontouchstart="">
<div class="wxapi_container">
<table id="aa" border="1">

</table>
</body>
<script>
 var Data={
    "data": [
        {
            "cavNo": "1",
            "num2": "2",
            "num3": "3",
            "num4": "4",
            "num5": "1"
        },
        {
            "cavNo": "2",
            "num2": "2",
            "num3": "3",
            "num4": "4",
            "num5": "2"
        },
        {
            "cavNo": "2",
            "num2": "",
            "num3": "",
            "num4": "",
            "num5": "3"
        },
        {
            "cavNo": "2",
            "num2": "",
            "num3": "",
            "num4": "",
            "num5": "4"
        },
        {
            "cavNo": "3",
            "num2": "",
            "num3": "",
            "num4": "3",
            "num5": "4"
        },
        {
            "cavNo": "4",
            "num2": "2",
            "num3": "3",
            "num4": "4",
            "num5": "6"
        },
        {
            "cavNo": "4",
            "num2": "",
            "num3": "",
            "num4": "",
            "num5": "7"
        },
        {
            "cavNo": "4",
            "num2": "",
            "num3": "",
            "num4": "",
            "num5": "9"
        }
    ]
};




var lastCavNo=-1;
var rowspanNo=1;
for(i=0;i<Data.data.length;i++){        
    var $table = $('#aa');
	var cavNo=Data.data[i].cavNo;	
	if(cavNo!=lastCavNo){
		var tr = "<tr><td>"+ Data.data[i].cavNo+"</td><td>"+ Data.data[i].num2+"</td><td>"+ Data.data[i].num3+"</td><td>"+ Data.data[i].num4+"</td><td>"+ Data.data[i].num5+"</td></tr>";
		rowspanNo=1;
	}else{
		rowspanNo++;
		var rowCount=$("#aa tr").length+1;	
		
		$('#aa').find('tr').eq(rowCount - rowspanNo).find('td').eq(0).attr("rowspan",rowspanNo);
		$('#aa').find('tr').eq(rowCount - rowspanNo).find('td').eq(1).attr("rowspan",rowspanNo);
		$('#aa').find('tr').eq(rowCount - rowspanNo).find('td').eq(2).attr("rowspan",rowspanNo);
		$('#aa').find('tr').eq(rowCount - rowspanNo).find('td').eq(3).attr("rowspan",rowspanNo);
		
		var tr = "<tr><td>"+ Data.data[i].num5+"</td></tr>";	
		
		
	}
    $table.append(tr);  
	lastCavNo=cavNo;
}
</script>
</html>
